
package es.ranking.padel.entidades;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;



/**
 * The Class User.
 */
@Entity /**JPA annotations**/
@Table(name = "user")
public class User implements Serializable{

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;
	
	/** The id. */
	private int id;
	
	/** The name. */
	private String name;
	
	/** The surname. */
	private String surname;

	/**
	 * Get User Id.
	 *
	 * @return int - User Id
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name = "ID", unique = true, nullable = false)
	public int getId() {
		return id;
	}

	/**
	 * Set User Id.
	 *
	 * @param id the id
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * Get User Name.
	 *
	 * @return String - User Name
	 */
	@Column(name = "NAME", unique = true, nullable = false)
	public String getName() {
		return name;
	}

	/**
	 * Set User Name.
	 *
	 * @param name the name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Get User Surname.
	 *
	 * @return String - User Surname
	 */
	@Column(name = "SURNAME", unique = true, nullable = false)
	public String getSurname() {
		return surname;
	}

	/**
	 * Set User Surname.
	 *
	 * @param surname the surname
	 */
	public void setSurname(String surname) {
		this.surname = surname;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuffer strBuff = new StringBuffer();
		strBuff.append("id : ").append(getId());
		strBuff.append(", name : ").append(getName());
		strBuff.append(", surname : ").append(getSurname());
		return strBuff.toString();
	}
}
